package com.mpcm.web.client.gin;

import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
import com.gwtplatform.mvp.client.gin.DefaultModule;
import com.mpcm.web.client.place.ClientPlaceManager;
import com.mpcm.web.client.core.MainPagePresenter;
import com.mpcm.web.client.core.MainPageView;
import com.mpcm.web.client.place.DefaultPlace;
import com.mpcm.web.client.place.NameTokens;
import com.mpcm.web.client.core.ResponsePresenter;
import com.mpcm.web.client.core.ResponseView;
import com.mpcm.web.client.core.HomeLayoutPresenter;
import com.mpcm.web.client.core.HomeLayoutView;
import com.mpcm.web.client.page.home.HomePresenter;
import com.mpcm.web.client.page.home.HomeView;
import com.mpcm.web.client.page.service.ServicePresenter;
import com.mpcm.web.client.page.service.ServiceView;
import com.mpcm.web.client.page.about.AboutPresenter;
import com.mpcm.web.client.page.about.AboutView;
import com.mpcm.web.client.page.cases.CasesPresenter;
import com.mpcm.web.client.page.cases.CasesView;
import com.mpcm.web.client.page.contact.ContactPresenter;
import com.mpcm.web.client.page.contact.ContactView;
import com.mpcm.web.client.admin.AdminLayoutPresenter;
import com.mpcm.web.client.admin.AdminLayoutView;
import com.mpcm.web.client.admin.AdminPresenter;
import com.mpcm.web.client.admin.AdminView;
import com.mpcm.web.client.admin.left.AdminLeftPresenter;
import com.mpcm.web.client.admin.left.AdminLeftView;

public class ClientModule extends AbstractPresenterModule {

	@Override
	protected void configure() {
		install(new DefaultModule(ClientPlaceManager.class));

		bindPresenter(MainPagePresenter.class, MainPagePresenter.MyView.class,
				MainPageView.class, MainPagePresenter.MyProxy.class);

		bindPresenter(ResponsePresenter.class, ResponsePresenter.MyView.class,
				ResponseView.class, ResponsePresenter.MyProxy.class);

		bindPresenter(HomeLayoutPresenter.class,
				HomeLayoutPresenter.MyView.class, HomeLayoutView.class,
				HomeLayoutPresenter.MyProxy.class);

		bindPresenter(HomePresenter.class, HomePresenter.MyView.class,
				HomeView.class, HomePresenter.MyProxy.class);

		bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.home);

		bindPresenter(ServicePresenter.class, ServicePresenter.MyView.class,
				ServiceView.class, ServicePresenter.MyProxy.class);

		bindPresenter(AboutPresenter.class, AboutPresenter.MyView.class,
				AboutView.class, AboutPresenter.MyProxy.class);

		bindPresenter(CasesPresenter.class, CasesPresenter.MyView.class,
				CasesView.class, CasesPresenter.MyProxy.class);

		bindPresenter(ContactPresenter.class, ContactPresenter.MyView.class,
				ContactView.class, ContactPresenter.MyProxy.class);

		bindPresenter(AdminLayoutPresenter.class,
				AdminLayoutPresenter.MyView.class, AdminLayoutView.class,
				AdminLayoutPresenter.MyProxy.class);

		bindPresenter(AdminPresenter.class, AdminPresenter.MyView.class,
				AdminView.class, AdminPresenter.MyProxy.class);

		bindSingletonPresenterWidget(AdminLeftPresenter.class,
				AdminLeftPresenter.MyView.class, AdminLeftView.class);
	}
}
